import axios from 'axios'
import qs from 'qs'
axios.defaults.withCredentials=true
axios.defaults.timeout=2000
let base="/api"

export const getcode = function(){
	return axios.get(base+"/web/verificationCode/get")
}

export const requestlogin=function(params){
	
	params = qs.stringify(params);
	return axios({
		method:'post',
		url:base+"/web/login",
		data:params,
		headers:{'Content-Type':'application/x-www-form-urlencoded'}
	})
	
}



export const getuserlist = function(params){
	
	return axios.get(base+"/web/user/query",{params:params})
}

export const getparkinglist = function(params){
	
	return axios.get(base+"/web/parkingspace/getParkingSpaceByPage",{params:params})
}

export const getparkingrecord = function(params){
	
	return axios.get(base+"/web/parkingRecord/getAllParkingRecord",{params:params})
}
export const recharge=function(params){
	params = qs.stringify(params);
	return axios({
		method:'post',
		url:base+"/web/user/virtualRecharge",
		data:params,
		headers:{'Content-Type':'application/x-www-form-urlencoded'}
	})
}